<template>
  <el-dialog
    :title="types === 'settlement' ? '结算订单详情' : '提现订单详情'"
    :visible.sync="visible"
    :before-close="handleClose"
    width="30%"
  >
    <el-form>
      <div v-if="types === 'settlement'">
        <el-form-item label="结算人：">
          {{ val.nick_name }}
        </el-form-item>
        <el-form-item label="结算角色：">
          <span v-if="val.distribute_type == 1">用户分销员</span>
          <span v-else>内部分销员</span>
        </el-form-item>
        <el-form-item label="分销员等级：">
          {{ val.distribute_name }}
        </el-form-item>
        <el-form-item label="结算时间：">
          {{ val.settlement_time }}
        </el-form-item>
        <el-form-item label="结算方式：">
          <span v-if="val.type == 1">自动结算</span>
          <span v-if="val.type == 2">手动结算</span>
          <span v-if="val.type == 3">后台结算</span>
        </el-form-item>
        <el-form-item label="结算状态：">
          <span v-if="val.settlement_status == 1">
            已结算
          </span>
          <span v-if="val.settlement_status == 2" style="color:#F56C6C;">
            结算失败
          </span>
        </el-form-item>
        <el-form-item v-if="val.fail_reason" label="结算失败原因：">
          {{ val.fail_reason }}
        </el-form-item>
        <el-form-item v-if="val.operator" label="后台结算人：">
          {{ val.operator }}
        </el-form-item>
        <el-form-item label="总计结算金额：">
          ￥{{ val.settlement_money }}
        </el-form-item>
      </div>
      <div v-else>
        <el-form-item label="提现人:">
          {{ val.nick_name }}
        </el-form-item>
        <el-form-item label="提现角色：">
          <span v-if="val.distribute_type == 1">用户分销员</span>
          <span v-else>内部分销员</span>
        </el-form-item>
        <el-form-item v-if="val.distribute_type == 1" label="分销员等级：">
          {{ val.distribute_name }}
        </el-form-item>
        <el-form-item v-if="val.distribute_type == 2" label="所属门店：">
          {{ val.store }}
        </el-form-item>
        <el-form-item label="提现时间：">
          {{ val.cash_time }}
        </el-form-item>
        <el-form-item label="提现金额："> ￥{{ val.cash_money }} </el-form-item>
        <el-form-item label="手续费：">
          0.6%
        </el-form-item>
        <el-form-item label="实际到账："> ￥{{ val.truemoney }} </el-form-item>
        <el-form-item label="提现状态：">
          <span v-if="val.status == 0">
            申请提现
          </span>
          <span v-if="val.status == 1">
            已提现
          </span>
          <span v-if="val.status == 2">
            提现打回
          </span>
        </el-form-item>
        <el-form-item v-if="val.distribute_type == 2" label="提现打回原因">
          {{ val.remarks }}
        </el-form-item>
      </div>
    </el-form>

    <!-- <span slot="footer">
      <el-button @click="handleClose">取 消</el-button>
      <el-button type="primary"
                 @click="handleSumbit">确 定</el-button>
    </span> -->
  </el-dialog>
</template>

<script>
export default {
  props: {
    visible: {
      type: Boolean,
      default: false
    },
    val: {
      type: Object,
      default: () => {}
    },
    types: {
      type: String,
      default: " "
    }
  },
  watch: {
    visible() {}
  },
  methods: {
    handleClose() {
      this.$emit("outDialog");
    }
  }
};
</script>
